package br.com.brasileirao.modelo;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
public class Clube implements Serializable{
	
	@Id
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SEQ_CLUBE")
	@SequenceGenerator(name="SEQ_CLUBE",sequenceName="SEQ_CLUBE",allocationSize=1,initialValue=1)
	private int id;
	
	@Column(name="nome")
	private String nome;
	
	@ManyToOne(cascade=CascadeType.ALL, fetch=FetchType.EAGER)
	@JoinColumn(name="endereco_id")
	private Endereco endereco; 
	
	@Temporal(TemporalType.DATE)
	@Column(name="dt_fundacao")
	private Date datafundacao;
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public Endereco getEndereco() {
		return endereco;
	}

	public void setEndereco(Endereco endereco) {
		this.endereco = endereco;
	}

	public Date getDatafundacao() {
		return datafundacao;
	}

	public void setDatafundacao(Date datafundacao) {
		this.datafundacao = datafundacao;
	}
	
	

}
